home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- //
- // Creation Date: May 29, 1997
- // Author: ajp
- //
- // Procedure Name:
- // AEalignCommon
- //
- // Description Name;
- // Creates the common attribute editor controls
- // for the alignCurve and align Surface Nodes
- //
- // Input Value:
- // nodeName
- //
- // Output Value:
- // None
- //
- /*
- global proc AEalignTangentCurvatureContinuityNew ( string $tangentContinuity,
- string $curvatureContinuity )
- {
- setUITemplate -pst attributeEditorTemplate;
- radioButtonGrp -l ""
- -l1 "Tangent Continuity"
- -l2 "Curvature Continuity"
- -nrb 2
- tangentCurvatureContinuityRadioButton;
- setUITemplate -ppt;
-
- AEalignTangentCurvatureContinuityReplace $tangentContinuity $curvatureContinuity;
- }
-
-
- global proc AEalignTangentCurvatureContinuityReplace ( string $tangentContinuity,
- string $curvatureContinuity )
- {
- string $nodeName[];
- tokenize($tangentContinuity, ".", $nodeName);
-
- connectControl -in 1 tangentCurvatureContinuityRadioButton $tangentContinuity;
- connectControl -in 2 tangentCurvatureContinuityRadioButton $curvatureContinuity;
- radioButtonGrp -e
- -cc1 ("tangentContinuityControls " + $nodeName[0] )
- -cc2 ("curvatureContinuityControls " + $nodeName[0] )
- -nrb 2
- tangentCurvatureContinuityRadioButton;
- }
-
- */
-
- global proc AEalignPositionContinuityTypeNew( string $attrName )
- {
- setUITemplate -pst attributeEditorTemplate;
- attrEnumOptionMenuGrp -attribute $attrName -l "Pos Continuity Type"
- positionContiunityTypeEnum;
- setUITemplate -ppt;
-
- AEalignPositionContinuityTypeReplace $attrName;
- }
-
- global proc AEalignPositionContinuityTypeReplace( string $attrName )
- {
- string $tmp[];
- tokenize($attrName, ".", $tmp);
- string $nodeName = $tmp[0];
-
- attrEnumOptionMenuGrp -e -attribute $attrName -l "Pos Continuity Type"
- positionContiunityTypeEnum;
-
- scriptJob -p positionContiunityTypeEnum -rp
- -ac $attrName ("positionalContinuityTypeControls " + $nodeName );
-
- evalDeferred ("positionalContinuityTypeControls " + $nodeName);
- }
-
- global proc AEalignTangentContinuityTypeNew( string $attrName )
- {
- setUITemplate -pst attributeEditorTemplate;
- attrEnumOptionMenuGrp -attribute $attrName -l "Tan Continuity Type"
- tangentContiunityTypeEnum;
- setUITemplate -ppt;
-
- AEalignTangentContinuityTypeReplace $attrName;
- }
-
- global proc AEalignTangentContinuityTypeReplace( string $attrName )
- {
- string $tmp[];
- tokenize($attrName, ".", $tmp);
- string $nodeName = $tmp[0];
-
- attrEnumOptionMenuGrp -e -attribute $attrName -l "Tan Continuity Type"
- tangentContiunityTypeEnum;
-
- scriptJob -p tangentContiunityTypeEnum -rp
- -ac $attrName ("interiorBlendingControls " + $nodeName );
-
- evalDeferred ("interiorBlendingControls " + $nodeName);
- }
-
- global proc AEalignCommon ( string $nodeName, string $whichAlignNode )
- {
-
- editorTemplate -beginScrollLayout;
-
- editorTemplate -beginLayout "Align History" -collapse false;
-
- if ($whichAlignNode == "curve") {
- editorTemplate -callCustom "AEinputNew \"Input Curve 1\""
- "AEinputReplace \"Input Curve 1\""
- "inputCurve1";
- editorTemplate -callCustom "AEinputNew \"Input Curve 2\""
- "AEinputReplace \"Input Curve 2\""
- "inputCurve2";
- } else {
- editorTemplate -callCustom "AEinputNew \"Input Surface 1\""
- "AEinputReplace \"Input Surface 1\""
- "inputSurface1";
- editorTemplate -callCustom "AEinputNew \"Input Surface 2\""
- "AEinputReplace \"Input Surface 2\""
- "inputSurface2";
- }
-
- editorTemplate -addControl "positionalContinuity"
- "positionalContinuityControls";
-
- editorTemplate -callCustom "AEalignPositionContinuityTypeNew"
- "AEalignPositionContinuityTypeReplace" "positionalContinuityType";
-
- /*
- editorTemplate -callCustom "AEalignTangentCurvatureContinuityNew"
- "AEalignTangentCurvatureContinuityReplace"
- "tangentContinuity"
- "curvatureContinuity";
- */
-
- editorTemplate -beginNoOptimize;
- editorTemplate -addControl "tangentContinuity"
- "tangentContinuityControls";
- editorTemplate -addControl "curvatureContinuity"
- "curvatureContinuityControls";
- editorTemplate -endNoOptimize;
-
- editorTemplate -callCustom "AEalignTangentContinuityTypeNew"
- "AEalignTangentContinuityTypeReplace" "tangentContinuityType";
-
- if ($whichAlignNode == "surface")
- editorTemplate -addControl "directionU";
-
- editorTemplate -addControl "joinParameter";
-
- editorTemplate -addControl "reverse1";
- editorTemplate -addControl "reverse2";
- if ($whichAlignNode == "surface") {
- editorTemplate -addControl "swap1";
- editorTemplate -addControl "swap2";
- editorTemplate -addControl "twist";
- }
-
- editorTemplate -beginLayout "Interior Blending First Object" -collapse false;
- editorTemplate -addControl "tangentScale1";
- editorTemplate -addControl "curvatureScale1";
- editorTemplate -endLayout;
-
- editorTemplate -beginLayout "Interior Blending Second Object" -collapse false;
- editorTemplate -addControl "tangentScale2";
- editorTemplate -addControl "curvatureScale2";
- editorTemplate -endLayout;
-
- editorTemplate -endLayout;
-
- // include/call base class/node attributes
- AEabstractBaseCreateTemplate $nodeName;
-
- editorTemplate -suppress positionalContinuityType;
- editorTemplate -suppress tangentContinuityType;
-
- editorTemplate -addExtraControls;
-
- editorTemplate -endScrollLayout;
-
- }
-
- global proc positionalContinuityControls( string $nodeName )
- {
- string $posAttrName = $nodeName + ".positionalContinuity";
- string $tanAttrName = $nodeName + ".tangentContinuity";
- string $crvAttrName = $nodeName + ".curvatureContinuity";
- int $posAttrValue = `getAttr $posAttrName`;
-
- if ($posAttrValue == 0) {
- // must have at least position alignment
- //setAttr $posAttrName 1;
- //setAttr $tanAttrName 0;
- //setAttr $crvAttrName 0;
- editorTemplate -dimControl $nodeName "positionalContinuityType" true;
- } else {
- editorTemplate -dimControl $nodeName "positionalContinuityType" false;
- }
- interiorBlendingControls($nodeName);
- }
-
- global proc positionalContinuityTypeControls( string $nodeName )
- {
- string $posTypeAttrName = $nodeName + ".positionalContinuityType";
- int $posAttrTypeValue = `getAttr $posTypeAttrName`;
-
- if ( $posAttrTypeValue == 3 || $posAttrTypeValue == 6 )
- {
- // can't change join parameter when "both" positional type
- editorTemplate -dimControl $nodeName "joinParameter" true;
- }
- else
- {
- editorTemplate -dimControl $nodeName "joinParameter" false;
- }
- }
-
- global proc tangentContinuityControls( string $nodeName )
- {
- string $posAttrName = $nodeName + ".positionalContinuity";
- string $tanAttrName = $nodeName + ".tangentContinuity";
- string $crvAttrName = $nodeName + ".curvatureContinuity";
- int $tanAttrValue = `getAttr $tanAttrName`;
- int $posAttrValue = `getAttr $posAttrName`;
- int $crvAttrValue = `getAttr $crvAttrName`;
-
- // want to disable curvature alignment regardless
- //if ($crvAttrValue == 1)
- // setAttr $crvAttrName 0;
- editorTemplate -dimControl $nodeName "curvatureScale1" true;
- editorTemplate -dimControl $nodeName "curvatureScale2" true;
-
- if ($tanAttrValue == 1) {
- //if ($posAttrValue == 0 )
- // setAttr $posAttrName 1;
- editorTemplate -dimControl $nodeName "tangentContinuityType" false;
- } else {
- setAttr $crvAttrName 0;
- editorTemplate -dimControl $nodeName "tangentContinuityType" true;
- }
- interiorBlendingControls($nodeName);
- }
-
- global proc curvatureContinuityControls( string $nodeName )
- {
- string $posAttrName = $nodeName + ".positionalContinuity";
- string $tanAttrName = $nodeName + ".tangentContinuity";
- string $crvAttrName = $nodeName + ".curvatureContinuity";
- int $crvAttrValue = `getAttr $crvAttrName`;
- int $tanAttrValue = `getAttr $tanAttrName`;
- int $posAttrValue = `getAttr $posAttrName`;
-
- if ($crvAttrValue == 1) {
- //if ($posAttrValue == 0)
- // setAttr $posAttrName 1;
- if ($tanAttrValue == 0){
- setAttr $tanAttrName 1;
- setAttr $crvAttrName 1;
- }
- editorTemplate -dimControl $nodeName "tangentContinuityType" false;
- }
- interiorBlendingControls($nodeName);
- }
-
- global proc interiorBlendingControls( string $nodeName )
- {
- string $crvAttrName = $nodeName + ".curvatureContinuity";
- string $tanAttrName = $nodeName + ".tangentContinuity";
- string $tanTypeAttrName = $nodeName + ".tangentContinuityType";
-
- int $crvValue = `getAttr $crvAttrName`;
- int $tanValue = `getAttr $tanAttrName`;
- int $tanTypeValue = `getAttr $tanTypeAttrName`;
-
- if ($tanValue == 0) {
- editorTemplate -dimControl $nodeName "tangentScale1" true;
- editorTemplate -dimControl $nodeName "curvatureScale1" true;
- editorTemplate -dimControl $nodeName "tangentScale2" true;
- editorTemplate -dimControl $nodeName "curvatureScale2" true;
- editorTemplate -dimControl $nodeName "tangentContinuityType" true;
- } else {
- editorTemplate -dimControl $nodeName "tangentScale1" false;
- editorTemplate -dimControl $nodeName "tangentScale2" false;
- if ($crvValue == 1) {
- editorTemplate -dimControl $nodeName "curvatureScale1" false;
- editorTemplate -dimControl $nodeName "curvatureScale2" false;
- } else {
- editorTemplate -dimControl $nodeName "curvatureScale1" true;
- editorTemplate -dimControl $nodeName "curvatureScale2" true;
- }
- }
- }
-